#include "stdafx.h"
#include "ConstStr.h"
#include "Impl/ConstStrImpl.h"

using namespace Base::ConstStr;

ConstStr::ConstStr()
    : m_impl(0)
{
    m_impl = new ConstStrImpl<std::string>;
}

ConstStr::~ConstStr()
{
    if (m_impl)
    {
        delete m_impl;
        m_impl = 0;
    }
}

ConstStr*
ConstStr::get()
{
    static ConstStr theInstance;
    return &theInstance;
}

const std::string*
ConstStr::string(const std::string& str)
{
    return m_impl->string(str);
}